var win32 = require('./win32.js');

win32.onLoad(function(){
	var main = win32.Body({
		title: "Win32 API 测试",
		left: 100,
		top: 100,
		width: 640,
		height: 480
	});
	main.onDestroy(function(){
		win32.exit(0);
	});

	var ar = main.area({
		left: 200,
		top: 100,
		width: 320,
		height: 240
	});

	var bg = ar.element(win32.Rect,{
		width: 320,
		height: 240,
		hbr: win32.createBrush(0,120,240)
	});
	
	var btn = ar.element(win32.Image,{
		left: 10,
		top: 20,
		width: 301,
		height: 201,
		hbmp: win32.createBitmap("bg.bmp"),
		mode: 2
	});
	
	var lab = ar.element(win32.Text,{
		left: 20,
		top: 20,
		text: "DO0Il1 日曰土士",
		hfont: win32.createFont("微软雅黑",48)
	});
	
	console.log(win32.getTextInfo(lab.hfont(),lab.text()));
});